<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateNewsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('news', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('title')->comment('seo 标题');
            $table->string('keywords')->comment('seo 关键词');
            $table->string('description')->comment('描述');
            $table->string('news_title')->comment('新闻标题');
            $table->string('abstract')->comment('新闻摘要');
            $table->string('img')->comment('新闻缩略图');
            $table->text('banner')->comment('新闻banner图');
            $table->text('content')->comment('新闻内容');
            $table->tinyInteger('is_show')->comment('新闻是否显示')->default(0);
            $table->tinyInteger('recommend')->comment('是否推荐显示')->default(0);
            $table->tinyInteger('news_type')->comment('新闻类别')->default(2);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('news');
    }
}
